package cn.wjssl.domain.strategy.model.entity;

import cn.wjssl.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * 抽奖行为对象, 用于表示不同过滤阶段下的抽奖行为信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;

    // 抽奖行为类标准
    public static class RaffleEntity {

    }

    // 抽奖前置过滤 抽奖行为对象, 包含策略Id, 奖品Id, rule_value值, 用于过滤器使用
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class RaffleBeforeEntity extends RaffleEntity {
        /**
         * 策略ID
         */
        private Long strategyId;

        /**
         * 权重值Key；用于抽奖时可以选择权重抽奖。
         */
        private String ruleWeightValueKey;

        /**
         * 奖品ID；
         */
        private Integer awardId;
    }

    // 抽奖之中
    public static class RaffleCenterEntity extends RaffleEntity {

    }

    // 抽奖之后
    public static class RaffleAfterEntity extends RaffleEntity {

    }


}
